<#assign pageName="系统资源管理">
<@override name="page-content">
<form class="layui-form form-horizontal" role="form" method="post">
    <div class="layui-form-search panel">
        <input type="text" hidden="hidden" name="_STATE"/>
        <@ctrl.TreeSelectQuery path="resources.guid" dataList=guidsList![] fieldText="sysModuleName"  class=""
            fieldValue="guid" labelText="所属平台" fieldParentID="upperGuid" parentidValue="${(guids.upperGuid)!'-1'}" />
        <@ctrl.SingleSelectQuery path="resources.type" labelText="资源类型" options={'URL':'URL','METHOD':'METHOD'}/>
        <div class="margin-5">
            <a href="javascript:;" onclick="$('form:first').submit();" class="layui-btn layui-btn-sm">
                <i class="layui-icon layui-icon-search"></i>查询
            </a>
            <a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-sm js-add">
                <i class="layui-icon layui-icon-add-1"></i>新增
            </a>
        </div>
    </div>
    <table class="layui-table">
        <thead>
            <tr>
                <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                <th class="align-center" nowrap="nowrap">资源类型</th>
                <th class="align-center layui-hide-xs" nowrap="nowrap" >优先级别</th>
                <th class="align-center" nowrap="nowrap">资源名称</th>
                <th class="align-center" nowrap="nowrap" >资源内容</th>
                <th class="layui-hide-xs align-center">资源说明</th>
                <th class="align-center" width="120px">操作</th>
            </tr>
        </thead>

        <tbody>
        <#if (queryResult.rows)?has_content>
            <#list queryResult.rows as dataItem>  
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${(pageNo-1)*pageSize+dataItem_index+1}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        ${dataItem.type}
                    </td>
                    <td class="align-center layui-hide-xs" >
                        <span title="${dataItem.priority}">${dataItem.priority}</span>
                    </td>
                    <td nowrap="nowrap">
                        ${dataItem.name}
                    </td>
                    <td nowrap="nowrap">
                        <span title="${dataItem.content}">${dataItem.content}</span>
                    </td>
                    <td class="layui-hide-xs" >
                        <span title="${dataItem.memo}">${dataItem.memo}</span>
                    </td>
                    <td class="align-center">
                        <div class="layui-table-cell">
                             <a class="layui-btn layui-btn-normal layui-btn-xs" href="edit/${dataItem.resId}">
                                <i class="layui-icon layui-icon-edit"></i>编辑
                             </a> 
                             <button type="button" class="layui-btn layui-btn-danger layui-btn-xs"
                                onclick="confirmSubmit('确定要删除资源‘${dataItem.name}’数据吗？', {resId:'${dataItem.resId}',resName:'${dataItem.name}'}, 'del')">
                                <i class="layui-icon layui-icon-delete"></i>删除
                            </button>
                        </div>
                    </td>
                </tr>
            </#list>
        <#else>
            <tr>
                <td colspan="7" style="color:red;text-align:center;font-weight:bold;">暂无符合条件的资源数据信息</td>
            </tr>
        </#if>
        </tbody>
    </table>
    <@ctrl.pageShow (queryResult.toal)!0, (queryResult.pageIndex)!0 />
</form>
</@override>
<@override name="page-scripts">
     <script>
        $(function(){
            layui.use(['form','layer', 'jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var $ = layui.jquery;
                $('.js-add').on('click', function(){
                    var guid = $('#guid').val();
                    window.location.href="${contextPath}/admin/resources/add/"+guid;
                })
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 